<template>
<div>
  <h2>我是App组件</h2>
  <div>
    <p v-pink>自定义指令test1</p>
    <p v-pink>自定义指令test2</p>
    <p v-bgColor="'yellowgreen'">自定义指令test3</p>
    <p v-bgColor="'skyblue'">自定义指令test4</p>
  </div>
  <Count></Count>
</div>
</template>


<script>
import Count from "@/components/Count";
export default {
    name:"App",
    components:{
      Count,
    },
  directives:{
      pink(el){
        console.log("el.parentNode",el.parentNode)
        el.style.background = "pink";
      },
      bgColor(el,binding){
        console.log(el,binding)
        el.style.background = binding.value;
      }
  }
}
</script>


<style></style>